package com.alexrnl.BetaSeriesFileManager.API.entities.enums;

import com.alexrnl.BetaSeriesFileManager.API.entities.Subtitle;

/**
 * Enumeration representing the language of a {@link Subtitle}.
 * @author Alex
 */
public enum Language {
	/**
	 * French subtitles.
	 */
	VF ("VF"),

	/**
	 * English subtitles.
	 */

	VO ("VO"),

	/**
	 * Both French and English subtitles.
	 */
	VOVF ("VOVF");

	private String	language;

	/**
	 * Constructor.
	 * @param language
	 *            the language of the {@link Subtitle}
	 */
	private Language (final String language) {
		this.language = language;
	}

	/**
	 * @return the language.
	 */
	public String getLanguage () {
		return language;
	}


	/**
	 * Retrieve a {@link Language}.
	 * @param language
	 *            the language to look for.
	 * @return the matching enumeration, if it exist
	 */
	public static Language fromName (final String language) {
		return Enum.valueOf(Language.class, language);
	}
}
